<template>
  <div>
    <vue-qr
      :text="QRcodeUrl"
      :margin="0"
      colorDark="#000"
      colorLight="#fff"
      :logoScale="0.3"
      :size="size"
    ></vue-qr>
  </div>
</template>
<script>
import vueQr from "vue-qr";
export default {
  props:{
    voteId:{
      type:String,
      default:''
    },
    size:{
       type:Number,
      default:200
    }
  },
  components: {
    vueQr,
  },
  data() {
    return {
      QRcodeUrl: "",
    };
  },
  created() {
    this.$api("vote.getqrcode", {
      id: this.voteId,
    }).then((res) => {
      this.QRcodeUrl = res;
      this.$emit('handleQR',res)
    });
  },
};
</script>